import { reactive } from "vue";

export const useColumns = () => {
  // 表格列的配置
  const columns = reactive([
    {
      title: "id",
      dataIndex: "id",
      key: "id",
      width: 60,
      align: "center",
    },
    {
      title: "发布人id",
      dataIndex: "user_id",
      key: "user_id",
      width: 100,
      align: "center",
    },
    {
      title: "类别",
      dataIndex: "pet_type",
      key: "pet_type",
      width: 100,
      align: "center",
    },
    {
      title: "宠物品种",
      dataIndex: "pet_variety",
      key: "pet_variety",
      align: "center",
    },
    {
      title: "宠物性别",
      key: "pet_gender",
      slots: { customRender: "gender" },
      width: 100,
      align: "center",
    },
    {
      title: "宠物年龄",
      dataIndex: "pet_age",
      key: "pet_age",
      width: 100,
      align: "center",
    },
    {
      title: "疫苗情况",
      dataIndex: "pet_vaccin",
      key: "pet_vaccin",
      slots: { customRender: "vaccin" },
      width: 100,
      align: "center",
    },
    {
      title: "绝育情况",
      dataIndex: "pet_sterilization",
      key: "pet_sterilization",
      slots: { customRender: "sterilization" },
      width: 100,
      align: "center",
    },
    {
      title: "驱虫情况",
      dataIndex: "pet_Insect_repellent",
      key: "pet_Insect_repellent",
      slots: { customRender: "repellent" },
      width: 100,
      align: "center",
    },
    {
      title: "照片",
      key: "pet_images",
      slots: { customRender: "images" },
      align: "center",
    },
    {
      title: "送养地址",
      dataIndex: "pet_giveaddress",
      key: "pet_giveaddress",
      width: 300,
      align: "center",
    },
    {
      title: "信息介绍",
      dataIndex: "pet_intro",
      key: "pet_intro",
      width: 300,
      ellipsis: true,
      align: "center",
    },
    {
      title: "操作",
      key: "operation",
      slots: { customRender: "operation" },
      fixed: "right",
      align: "center",
    },
  ]);

  return {
    columns,
  };
};
